/**
 * 
 */
package de.cbf.cam.dsa.battle.logic.commands;

import java.util.ArrayList;
import java.util.List;

import de.cbf.cam.dsa.battle.exceptions.ParseCommandException;
import de.cbf.cam.dsa.model.entities.states.stateChanger.StateChangerBase;
import de.cbf.cam.dsa.model.entities.states.stateChanger.StateChangerINI;

/**
 * @author Nebelritter
 *
 */
public class OneCommandChangeINI extends OneCommandBase {

	
	public OneCommandChangeINI() {
		super();
		name ="ini:";
	}

	@Override
	public List<StateChangerBase> evaluateCommand(String oneCommand)
			throws ParseCommandException {
		List<StateChangerBase> stateChangersResult = new ArrayList<StateChangerBase>();
		String stringValues=oneCommand.substring(name.length(),oneCommand.length());
		try{
			Integer value = Integer.parseInt(stringValues);
			StateChangerINI changeINI = new StateChangerINI(value);
			stateChangersResult.add(changeINI);
		}catch (NumberFormatException e) {
			throw new ParseCommandException("Wrong parameters :",e);
		}
		
		return stateChangersResult;
	}

}
